println "calculating total time";

finalTime = System.nanoTime();
dt = finalTime - initialTime;

println "dt=" + dt + " ns, " + dt*0.000000001 + "s";